
$(function () {
    function noticeAnimate() {
        setTimeout(function () {
            let top = parseInt($("#notice-list").css("top"))
            $("#notice-list").animate({top: top - 25 + 'px'}, 1000, function () {
                var target = document.getElementById("notice-list");
                target.appendChild(target.firstElementChild);
                $("#notice-list").css("top", "0");
                noticeAnimate();
            });
        }, 3000);
    }

    noticeAnimate();

    $(".nav-mobile-button").click(function () {
        $(".panel-right").show();
        $("#side-out-right").animate({"right":"0"},300);
    })
    
    $(".panel-right").click(function (e) {
        if(e.target.className!=='panel-right') return;
        $("#side-out-right").animate({"right":"-280px"},300,function () {
            $(".panel-right").hide();
        });
    })

    $(".search-container").click(function () {
        $(".search-panel").animate({"top":"5px"},300);
    })

    $(".close-btn").click(function () {
        let panel = $(this).attr("for");
        $("#"+panel).animate({"top":"-60px"},300);
    })

    //返回顶部
    $("#scroll-to-top").click(function() {
        $('body,html').animate({
                scrollTop: 0
            },
            500);
    });
})